from airflow.patsnap.service import backfill_service
from airflow.models.dagpickle import DagPickle
from airflow.utils import dates

dag_graph_id = 9

start_date = 1612150083000
end_date = 1612168083000

start_date = dates.from_milliseconds(start_date)
end_date = dates.from_milliseconds(end_date)

dag_pickle = DagPickle.get_by_dag('dag-{}'.format(dag_graph_id))

dag = dag_pickle.pickle
backfill_service.dag_back_fill(dag, start_date, end_date)
